#include <bits/stdc++.h>
using namespace std;

int main(){
	int currentDay=6;
	int ans=1;
	for(int i=1;i<=22;i++){
		ans=((ans%7)*(20%7))%7;
	}
	if((currentDay+ans)%7==0)
		cout<<"7";
	else
		cout<<(currentDay+ans)%7;
	return 0;
}
